let charaters = {
    mona: {
        name: "lv90莫娜", 
        base: 287,
        充能: 32,
        criticalRate: 5,
        criticalStrike: 50
    },
    dio: {
        name: "lv90迪奥娜", 
        base: 212,
        dmgRate: 24,
        criticalRate: 5,
        criticalStrike: 50
    },
    babala: {
        name: "lv90芭芭拉", 
        base: 159,
        hp:9787,
        hpRate: 24,
        criticalRate: 5,
        criticalStrike: 50
    },
    shatang: {
        name: "lv90砂糖", 
        base: 170,
        dmgRate: 24,
        criticalRate: 5,
        criticalStrike: 50
    },
    bannite: {
        name: "lv90班尼特", 
        base: 191,
        充能: 26.7,
        criticalRate: 5,
        criticalStrike: 50
    },
    anbo: {
        name: "lv90安博", 
        base: 223,
        attRate: 24,
        criticalRate: 5,
        criticalStrike: 50
    },
    kaiya: {
        name: "lv90凯老版", 
        base: 223,
        充能: 26.7,
        criticalRate: 5,
        criticalStrike: 50
    },
    lisa: {
        name: "lv90丽萨", 
        base: 232,
        元素精通: 96,
        criticalRate: 5,
        criticalStrike: 50
    },
    zhongli: {
        name: "lv90钟离", 
        base: 251,
        hp:14695,
        dmgRate: 28.8,
        criticalRate: 5,
        criticalStrike: 50 
    },
    qing: {
        name: "lv90琴", 
        base: 239,
        治疗: 22.2,
        criticalRate: 5,
        criticalStrike: 50 
    },
    "77": {
        name: "lv90七七", 
        base: 287,
        治疗: 22.2,
        criticalRate: 5,
        criticalStrike: 50 
    },
    xianglin: {
        name: "lv90香菱", 
        base: 225,
        元素精通: 96,
        criticalRate: 5,
        criticalStrike: 50
    },
    chongyun: {
        name: "lv90重云", 
        base: 223,
        attRate: 24,
        criticalRate: 5,
        criticalStrike: 50
    },
    blackXinyan: {
        name: "lv90非洲鸡", 
        base: 249,
        attRate: 24,
        criticalRate: 5,
        criticalStrike: 50
    },
    xingqiu: {
        name: "lv90行秋", 
        base: 202,
        attRate: 24,
        criticalRate: 5,
        criticalStrike: 50
    },
    beidou: {
        name: "lv90北斗", 
        base: 225,
        dmgRate: 24,
        criticalRate: 5,
        criticalStrike: 50
    },
    ningguang: {
        name: "lv90凝光", 
        base: 212,
        dmgRate: 24,
        criticalRate: 5,
        criticalStrike: 50
    },
    lxz: {
        name: "lv90旅行者", 
        base: 212,
        attRate: 24,
        criticalRate: 5,
        criticalStrike: 50
    },
    xiao : {
        name: "lv90魈", 
        base: 349,
        criticalRate: 24.2,
        criticalStrike: 50
    },
    keli : {
        name: "lv90可莉", 
        base: 311,
        criticalRate: 5,
        criticalStrike: 50,
        dmgRate: 28.8
    },
    gz: {
        name: "lv90公子", 
        base: 301,
        criticalRate: 5,
        criticalStrike: 50,
        dmgRate: 28.8
    },
    lu : {
        name: "lv90卢", 
        base: 335,
        criticalRate: 24.2,
        criticalStrike: 50
    },
    ke : {
        name: "lv90刻", 
        base: 323,
        criticalRate: 24.2,
        criticalStrike: 50 + 38.4
    },
    nvpu: {
        name: "lv90女仆", 
        base: 191,
        criticalRate: 5,
        criticalStrike: 50,
        defence:799,
        defenceRate: 30
    },
    wendi: {
        name: "lv90温蒂", 
        base: 263,
        criticalRate: 5,
        criticalStrike: 50,
    },
    aimi: {
        name: "lv90皇女", 
        base: 244,
        attRate: 24,
        criticalRate: 5,
        criticalStrike: 50
    },
    leize : {
        name: "lv90雷泽", 
        base: 234,
        criticalRate: 5,
        criticalStrike: 50,
        dmgRate: 30
    },
}

let weapons = {
    lvqiang: {
        name:"lv90绿枪",
        base: 674,
        criticalRate: 22.1,
        attRate: 42,
        dmgRate: 24
    },
    guanhong: {
        name:"lv90贯虹之塑",
        base: 608,
        attRate: 49.6 + 80  
    },
    tkDj: {
        name:"lv90天空之傲", // q后普攻8次攻击力x1.6 真空刃
        dmgRate: 16,
        base: 674,
        充能: 36.8
    },
    langmo: { 
        name:"lv90狼末",
        base: 608,
        attRate: 49.6 + 40
    },
    langmoBuff: { 
        name:"lv90狼末buff",
        base: 608,
        attRate: 49.6 + 40 + 80
    },
    sifeng: {
        name:"lv90四风",
        base: 608,
        criticalRate: 33.1,
        dmgRate:32
    },
    dunjian: {
        name: "lv90斩峰之剑",
        base: 608,
        attRate: 69.6 + 80
    },
    neiguijian: {
        name: "lv90内鬼单手剑",
        base: 608,
        criticalRate: 22.1,
        criticalStrike:30
    },
    tiankj: {
        name:"lv90天空弓",  // 每两秒 一次 1.25 * 攻击力 物理伤害
        base: 674,
        criticalRate: 22.1,
        criticalStrike:40
    },
    gongzang: {
        name:"lv90弓藏",  // 80增伤
        base: 510,
        attRate:41.3
    },
    amosi: {
        name: "lv90阿莫斯",  // 24增伤
        base: 608,
        attRate:49.6
    },
    baiyin:{
        name:"lv90白影剑",
        base: 510,
        attRate: 48,
        defenceRate:51.7 + 48 
    },
    cg:{
        name:"lv90骨剑",
        base: 510,
        criticalRate: 27.6,
        dmgRate:50
    },
    hj:{
        name:"lv90黑剑",  // 普攻重击40增伤
        base: 510,
        criticalRate: 27.6
    },
    gh: {
        name:"lv90古华",  // 15s 一次 攻击力x4.8 伤害
        base: 565,
        attRate: 27.6
    },
    xz: {
        name:"lv90霜葬",  // 10s 一次 1.4/3.6(敌人被冰附着) * 1.5(15s输出率) 
        base: 565,
        dmgRate: 34.5
    },
    fs: {
        name:"lv90腐蚀",  // e技能获得32增伤  12暴击
        base: 510,
        "充能": 45.9
    },
    dj: {
        name:"lv90笛剑",  // 5音符 一次 攻击力x2 伤害   15s大概触发3次   相当于攻击力x6
        base: 510,
        attRate: 41.3
    },
    lm: {
        name:"lv90黎明", 
        base: 401,  
        criticalStrike: 46.9,
        criticalRate:28
    }
}
let normal_clips = calc_clips_normal();
let defence_clips = calc_clips_defence();
let charactersDmg = []
// 雷泽
// charactersDmg.push(getDMG([charaters.leize,weapons.cg,{fixedAtt:311,criticalRate:31.1,dmgRate:58.3,attRate:46.6},normal_clips], (data,second) => {
//     // 脚斗士四件套
//     data.attRate += 18;
//     data.dmgRate += 35;
//     let attack = data.base *(1 + data.attRate/100) + data.fixedAtt
//     let eonce = getDmgDps({...data,dmgRate:0}, 3.59) * q(10) * df(90,90); // 第一次e
//     let edmg = getDmgDps({...data,dmgRate:10}, 3.59) * q(10) * df(90,90);
//     let qdmg = getDmgDps({...data,dmgRate:10}, 2.88) * q(10) * df(90,90,15);
//     let yl = attack * 1.1 * q(10) * df(90,90,15);
//     let admg = getDmgDps(data, 1.71+1.47+1.84+2.43) * q(10) * df(90,90,15);
//     let qadmg = getDmgDps({...data,dmgRate:10}, 1.71+1.47+1.84+2.43) * q(10) * df(90,90,15);
//     // 3.59  q 2.88  43.2%普攻雷伤
//     let ret = eonce + qdmg + edmg*2 + yl + admg * 4 +qadmg*4
//     return {point:ret, data, second , eonce,edmg,qdmg,yl, admg,qadmg}
// }))

// // 雷泽
// charactersDmg.push(getDMG([charaters.leize,weapons.gh,{fixedAtt:311,criticalRate:31.1,dmgRate:58.3,attRate:46.6},normal_clips], (data,second) => {
//     // 脚斗士四件套
//     data.attRate += 18;
//     data.dmgRate += 35;
//     let attack = data.base *(1 + data.attRate/100) + data.fixedAtt
//     let eonce = getDmgDps({...data,dmgRate:0}, 3.59) * q(10) * df(90,90); // 第一次e
//     let edmg = getDmgDps({...data,dmgRate:10}, 3.59) * q(10) * df(90,90);
//     let qdmg = getDmgDps({...data,dmgRate:10}, 2.88) * q(10) * df(90,90,15);
//     let yl = attack * 1.1 * q(10) * df(90,90,15);
//     let admg = getDmgDps(data, 1.71+1.47+1.84+2.43) * q(10) * df(90,90,15);
//     let qadmg = getDmgDps({...data,dmgRate:10}, 1.71+1.47+1.84+2.43) * q(10) * df(90,90,15);
//     // 3.59  q 2.88  43.2%普攻雷伤
//     let ret = eonce + qdmg + edmg*2 + yl + admg * 4 +qadmg*4 + attack*4.8
//     return {point:ret, data, second , eonce,edmg,qdmg,yl, admg,qadmg}
// }))

// // 雷泽
// charactersDmg.push(getDMG([charaters.leize,weapons.xz,{fixedAtt:311,criticalRate:31.1,dmgRate:58.3,attRate:46.6},normal_clips], (data,second) => {
//     // 脚斗士四件套
//     data.attRate += 18;
//     data.dmgRate += 35;
//     let attack = data.base *(1 + data.attRate/100) + data.fixedAtt
//     let eonce = getDmgDps({...data,dmgRate:0}, 3.59) * q(10) * df(90,90); // 第一次e
//     let edmg = getDmgDps({...data,dmgRate:10}, 3.59) * q(10) * df(90,90);
//     let qdmg = getDmgDps({...data,dmgRate:10}, 2.88) * q(10) * df(90,90,15);
//     let yl = attack * 1.1 * q(10) * df(90,90,15);
//     let admg = getDmgDps(data, 1.71+1.47+1.84+2.43) * q(10) * df(90,90,15);
//     let qadmg = getDmgDps({...data,dmgRate:10}, 1.71+1.47+1.84+2.43) * q(10) * df(90,90,15);
//     // 3.59  q 2.88  43.2%普攻雷伤
//     let ret = eonce + qdmg + edmg*2 + yl + admg * 4 +qadmg*4 + attack*1.5 * 3.6
//     return {point:ret, data, second , eonce,edmg,qdmg,yl, admg,qadmg}
// }))
// // 雷泽
// charactersDmg.push(getDMG([charaters.leize,weapons.langmoBuff,{fixedAtt:311,criticalRate:31.1,dmgRate:58.3,attRate:46.6},normal_clips], (data,second) => {
//     // 脚斗士四件套
//     data.attRate += 18;
//     data.dmgRate += 35;
//     let attack = data.base *(1 + data.attRate/100) + data.fixedAtt
//     let eonce = getDmgDps({...data,dmgRate:0}, 3.59) * q(10) * df(90,90); // 第一次e
//     let edmg = getDmgDps({...data,dmgRate:10}, 3.59) * q(10) * df(90,90);
//     let qdmg = getDmgDps({...data,dmgRate:10}, 2.88) * q(10) * df(90,90,15);
//     let yl = attack * 1.1 * q(10) * df(90,90,15);
//     let admg = getDmgDps(data, 1.71+1.47+1.84+2.43) * q(10) * df(90,90,15);
//     let qadmg = getDmgDps({...data,dmgRate:10}, 1.71+1.47+1.84+2.43) * q(10) * df(90,90,15);
//     // 3.59  q 2.88  43.2%普攻雷伤
//     let ret = eonce + qdmg + edmg*2 + yl + admg * 4 +qadmg*4
//     return {point:ret, data, second , eonce,edmg,qdmg,yl, admg,qadmg}
// }))

// // 雷泽
// charactersDmg.push(getDMG([charaters.leize,weapons.langmo,{fixedAtt:311,criticalRate:31.1,dmgRate:58.3,attRate:46.6},normal_clips], (data,second) => {
//     // 脚斗士四件套
//     data.attRate += 18;
//     data.dmgRate += 35;
//     let attack = data.base *(1 + data.attRate/100) + data.fixedAtt
//     let eonce = getDmgDps({...data,dmgRate:0}, 3.59) * q(10) * df(90,90); // 第一次e
//     let edmg = getDmgDps({...data,dmgRate:10}, 3.59) * q(10) * df(90,90);
//     let qdmg = getDmgDps({...data,dmgRate:10}, 2.88) * q(10) * df(90,90,15);
//     let yl = attack * 1.1 * q(10) * df(90,90,15);
//     let admg = getDmgDps(data, 1.71+1.47+1.84+2.43) * q(10) * df(90,90,15);
//     let qadmg = getDmgDps({...data,dmgRate:10}, 1.71+1.47+1.84+2.43) * q(10) * df(90,90,15);
//     // 3.59  q 2.88  43.2%普攻雷伤
//     let ret = eonce + qdmg + edmg*2 + yl + admg * 4 +qadmg*4
//     return {point:ret, data, second , eonce,edmg,qdmg,yl, admg,qadmg}
// }))

// // 皇女
// charactersDmg.push(getDMG([charaters.aimi,weapons.tiankj,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,attRate:46.6}], (data,second) => {
//     // 4雷
//     data.dmgRate += 15;
//     let edmg = getDmgDps(data, 2.08) * q(10) * df(90,90);
//     let eafdmg = getDmgDps(data, 1.6) * q(10) * df(90,90);
//     let ret = edmg + eafdmg * 10
//     return {point:ret, data, second, edmg,eafdmg}
// }))

// // 可莉
// charactersDmg.push(getDMG([charaters.keli,weapons.sifeng,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,attRate:46.6}], (data,second) => {
//     // 4魔女 增伤+15 技能添加增伤 算常驻增伤 37.5
//     data.dmgRate += 30;
//     let edmg = getDmgDps(data, 1.71) * q(10) * df(90,90);
//     let qdmg = getDmgDps(data, 0.768*3) * q(10) * df(90,90);
//     let a1dmg = getDmgDps(data, 1.3) * q(10) * df(90,90);
//     let a1Sdmg = getDmgDps(data, 2.83) * q(10) * df(90,90);
//     data.dmgRate += 50;
//     let a1SdmgL = getDmgDps(data, 2.83) * q(10) * df(90,90);
//     let ret = qdmg*5 + edmg*5 + a1dmg*10 + a1Sdmg * 3 + +a1SdmgL*3
//     return {point:ret, data, second, edmg,qdmg,a1dmg,a1Sdmg,a1SdmgL}
// }))

// // 温蒂
// charactersDmg.push(getDMG([charaters.wendi,weapons.tiankj,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,attRate:46.6}], (data,second) => {
//     // 风 x 4
//     data.dmgRate += 15;
//     let qdmg = getDmgDps(data, 0.677) * q(10) * df(90,90);
//     let edmg = getDmgDps(data, 4.97) * q(10) * df(90,90);
//     let ret = qdmg * 20 + edmg;
//     return {point:ret, data, second, edmg,qdmg}
// }))

// // 女仆 天空
// charactersDmg.push(getDMG([charaters.nvpu,weapons.tkDj,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,defenceRate:58.3}], (data,second) => {
//     // 角斗士x4
//     data.attRate += 18;
//     data.dmgRate += 35;
//     let defToAtt = data.defence*(1 + data.defenceRate/100)* 1.22// 防御力的 122%
//     data.fixedAtt += defToAtt
//     let gjl = data.攻击力 + defToAtt
//     let qdmg = getDmgDps(data, 1.21+1.67) * q(10) * df(90,90);
//     let admg = getDmgDps(data, 1.56+1.45+1.71+2.24) * q(10) * df(90,90);
//     let a1 = getDmgDps(data, 1.56) * q(10) * df(90,90);
//     let ret = qdmg + admg*4 + 8*1.6*gjl;
//     return {point:ret, data, second, admg, defToAtt, a1}
// }))
// // 女仆 
// charactersDmg.push(getDMG([charaters.nvpu,weapons.langmoBuff,{fixedAtt:311,criticalRate:31.1,dmgRate:46.6,defenceRate:58.3},defence_clips], (data,second) => {
//     // 角斗士x4
//     data.attRate += 18;
//     data.dmgRate += 35;
//     let defToAtt = data.defence*(1 + data.defenceRate/100)* 1.22// 防御力的 122%
//     data.fixedAtt += defToAtt
//     let qdmg = getDmgDps(data, 1.21+1.67) * q(10) * df(90,90);
//     let admg = getDmgDps(data, 1.56+1.45+1.71+2.24) * q(10) * df(90,90);
//     let a1 = getDmgDps(data, 1.56) * q(10) * df(90,90);
//     let ret = qdmg + admg*4;
//     return {point:ret, data, second, admg, defToAtt, a1}
// }))

// 女仆 骨剑defence_clips
// charactersDmg.push(getDMG([charaters.nvpu,weapons.cg,{fixedAtt:311,criticalRate:31.1,dmgRate:46.6,defenceRate:58.3},defence_clips], (data,second) => {
//     // 角斗士x4
//     data.attRate += 18;
//     data.dmgRate += 35;
//     let defToAtt = data.defence*(1 + data.defenceRate/100)* 1.22// 防御力的 122%
//     data.fixedAtt += defToAtt
//     let qdmg = getDmgDps(data, 1.21+1.67) * q(10) * df(90,90);
//     let admg = getDmgDps(data, 1.56+1.45+1.71+2.24) * q(10) * df(90,90);
//     let a1 = getDmgDps(data, 1.56) * q(10) * df(90,90);
//     let ret = qdmg + admg*4;
//     return {point:ret, data, second, admg, defToAtt, a1}
// }))
// gongzang公子
// charactersDmg.push(getDMG([charaters.gz,weapons.amosi,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,attRate:46.6},normal_clips], (data,second) => {
//     // 水 x 4
//     data.dmgRate += 15;
//     let qdmg = getDmgDps(data, 8.35 + 2.16) * q(10) * df(90,90);
//     let edmg = getDmgDps(data, 1.3) * q(10) * df(90,90);
//     data.dmgRate += 30 + 12;
//     let eadmg = getDmgDps(data, 0.768+0.823+1.114+1.185+1.093+0.7+0.745+1.19) * q(10) * df(90,90);
//     let ret = qdmg + edmg + eadmg*5;
//     return {point:ret, data, second, edmg,qdmg,eadmg}
// }))
// // gongzang公子
// charactersDmg.push(getDMG([charaters.gz,weapons.gongzang,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,attRate:46.6},normal_clips], (data,second) => {
//     // 水 x 4
//     data.dmgRate += 15;
//     let qdmg = getDmgDps(data, 8.35 + 2.16) * q(10) * df(90,90);
//     let edmg = getDmgDps(data, 1.3) * q(10) * df(90,90);
//     data.dmgRate += 30 + 40;
//     let eadmg = getDmgDps(data, 0.768+0.823+1.114+1.185+1.093+0.7+0.745+1.19) * q(10) * df(90,90);
//     let ret = qdmg + edmg + eadmg*5;
//     return {point:ret, data, second, edmg,qdmg,eadmg}
// }))
// // 公子
// charactersDmg.push(getDMG([charaters.gz,weapons.tiankj,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,attRate:46.6},normal_clips], (data,second) => {
//     // 水 x 4
//     data.dmgRate += 15;
//     let attack = data.base *(1 + data.attRate/100) + data.fixedAtt
//     let qdmg = getDmgDps(data, 8.35 + 2.16) * q(10) * df(90,90);
//     let edmg = getDmgDps(data, 1.3) * q(10) * df(90,90);
//     data.dmgRate += 30;
//     let eadmg = getDmgDps(data, 0.768+0.823+1.114+1.185+1.093+0.7+0.745+1.19) * q(10) * df(90,90);
//     let ret = qdmg + edmg + eadmg*5 + 7 * attack*1.25*0.45;
//     return {point:ret, data, second, edmg,qdmg,eadmg}
// }))
// // 魈 绿枪
// charactersDmg.push(getDMG([charaters.xiao,weapons.lvqiang,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,attRate:46.6},normal_clips], (data,second) => {
//     // 双风双角斗效果
//     data.attRate += 18;
//     data.dmgRate += 15;   
//     let edmg = getDmgDps(data, 4.5504) * q(10) * df(90,90);
//     let admg = getDmgDps({...data,dmgRate:data.dmgRate+95.2}, 7.55) * q(10) * df(90,90);
//     let dz = getDmgDps({...data,dmgRate:data.dmgRate+95.2}, 3.64) * q(10) * df(90,90);
//     let ret = edmg*3 + admg*3 + dz * 3;
//     return {point:ret, data, second, edmg,admg, dz}
// }))
// // 魈 贯虹
// charactersDmg.push(getDMG([charaters.xiao,weapons.guanhong,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,attRate:46.6},normal_clips], (data,second) => {
//     // 双风双角斗效果
//     data.attRate += 18;
//     data.dmgRate += 15;   
//     let edmg = getDmgDps(data, 4.5504) * q(10) * df(90,90);
//     let admg = getDmgDps({...data,dmgRate:data.dmgRate+95.2}, 7.55) * q(10) * df(90,90);
//     let dz = getDmgDps({...data,dmgRate:data.dmgRate+95.2}, 3.64) * q(10) * df(90,90);
//     let ret = edmg*3 + admg*3 + dz * 3;
//     return {point:ret, data, second, edmg,admg, dz}
// }))

// 刻晴
// charactersDmg.push(getDMG([charaters.ke,weapons.neiguijian,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,attRate:46.6},normal_clips], (data,second) => {
//     // 角斗 雷伤2+2
//     data.attRate += 18;
//     data.criticalRate += 15;
//     data.dmgRate += 15;
//     let admg = getDmgDps(data, 3.22) * q(10) * df(90,90);
//     data.dmgRate += 35;
//     let edmg = getDmgDps(data, 3.02) * q(10) * df(90,90);
//     let qdmg = getDmgDps(data, 8.436) * q(10) * df(90,90);
//     let ret = qdmg + edmg*2 + admg*8
//     return {point:ret, data, second, edmg,admg,qdmg}
// }))

// // 刻晴
// charactersDmg.push(getDMG([charaters.ke,weapons.lm,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,attRate:46.6},normal_clips], (data,second) => {
//     // 角斗 雷伤2+2
//     data.attRate += 18;
//     data.criticalRate += 15;
//     data.dmgRate += 15;
//     let edmg = getDmgDps(data, 3.02) * q(10) * df(90,90);
//     let qdmg = getDmgDps(data, 8.436) * q(10) * df(90,90);
//     let admg = getDmgDps(data, 3.22) * q(10) * df(90,90);
//     let ret = qdmg + edmg*2 + admg*8
//     return {point:ret, data, second, edmg,admg,qdmg}
// }))

// // 刻晴
// charactersDmg.push(getDMG([charaters.ke,weapons.dunjian,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,attRate:46.6},normal_clips], (data,second) => {
//     // 角斗 雷伤2+2
//     data.attRate += 18;
//     data.criticalRate += 15;
//     data.dmgRate += 15;
//     let edmg = getDmgDps(data, 3.02) * q(10) * df(90,90);
//     let qdmg = getDmgDps(data, 8.436) * q(10) * df(90,90);
//     let admg = getDmgDps(data, 3.22) * q(10) * df(90,90);
//     let ret = qdmg + edmg*2 + admg*8
//     return {point:ret, data, second, edmg,admg,qdmg}
// }))

// // 地卢克
// charactersDmg.push(getDMG([charaters.lu,weapons.langmo,{fixedAtt:311,criticalStrike:62.2,dmgRate:46.6,attRate:46.6}], (data,second) => {
//     // 4魔女 增伤+15 技能添加增伤 算常驻增伤 30
//     data.dmgRate += 37.5;
//     let edmg = getDmgDps(data, 1.7+1.76+2.32) * q(10) * df(90,90);
//     let admg = getDmgDps(data, 1.77+1.73+1.95+2.65) * q(10) * df(90,90);
//     let qdmg = getDmgDps(data, 3.67+1.08*3+3.67) * q(10) * df(90,90);
//     let ret = qdmg + edmg + admg*2
//     return {point:ret, data, second, edmg,admg,qdmg}
// }))



console.log(charactersDmg.sort((a,b)=>b.point-a.point));


function getDMG(dataarr, getRet){
    let chance = 25;
    let _ret = [];
    for (let index = 0; index <= chance; index++) {
        let criticalStrike = index; 
        for (let index2 = 0; index2 <= chance - index; index2++) {
            let criticalRate = index2;
            for (let index3 = 0; index3 <= chance-index-index2; index3++) {
                let attRate = index3;
                let defenceRate = chance - index - index2 - index3;
                _ret.push({
                    defenceRate: 7.3 * defenceRate,
                    attRate:5.8 * attRate,
                    criticalRate:3.9 * criticalRate,
                    criticalStrike:7.8 * criticalStrike
                });
            }
        }
    }
    _ret = _ret.map(second => {
        let panel = getPanel([...dataarr, second]);
        panel.攻击力 = panel.base * (1 + panel.attRate/100) + panel.fixedAtt
        return  getRet(panel, second)
    })
    _ret.sort((b,a)=> a.point-b.point)
    return _ret[0]
}





function getDmgDps(data, rate=1){
    let criticalRate = data.criticalRate
    if(criticalRate > 100){criticalRate = 100}
    let baseat = data.base * (1 + data.attRate/100) + data.fixedAtt;
    let bdmg = baseat * (1 + data.criticalStrike/100);
    let bdps = (criticalRate * 10 * bdmg + (1000-criticalRate * 10)*baseat)/1000
    let adddmg = bdps * (1 + data.dmgRate/100)
    return adddmg * rate
}

function getPanel(arr){
    let info = {name1:"",name2:""};
    arr.forEach((item, i)=>{
        if(item.name){
            info["name" + (i+1)] = item.name
        }
        for (const key in item) {
            if(key !== "name"){
                if(info[key]){
                    info[key] += item[key]
                } else {
                    info[key] = item[key]
                }
            }
        }
    })
    return info
}


function q (resistance) {
    if(resistance < 0) {
        return 1 - resistance/200
    } else if (resistance >=0 && resistance < 75){
        return 1 - resistance/100
    } else {
        return 1/(1+resistance/100*4)
    }
}

function df(youLv=0, eLv=0, td){
    return (100+youLv)/(100+youLv+(100+eLv)*(td? (100-td)/100 : 1))
}



// 固定攻击力 19  防御力23 生命值299 5.3% 精通23
function calc_clips_normal () {
    let clips = [
        {
            fixedAtt: 19,
            attRate: 5.8,
            criticalRate: 3.9,
            criticalStrike:7.8
        },
        {
            fixedAtt: 19,
            attRate: 5.8,
            criticalRate: 3.9,
            criticalStrike:7.8
        },
        {
            fixedAtt: 19,
            criticalRate: 3.9,
            criticalStrike:7.8
        },
        {
            fixedAtt: 19,
            attRate: 5.8,
            criticalRate: 3.9,
            criticalStrike:7.8
        },
        {
            fixedAtt: 19,
            attRate: 5.8,
            criticalRate: 3.9
        }
    ]
    let data = {}
    clips.forEach(item => {
        for (const key in item) {
            data[key] = data[key]? (data[key]+item[key]) : item[key]
        }
    })
    return data
}

function calc_clips_defence () {
    let clips = [
        {
            defenceRate: 7.3,
            attRate: 5.8,
            criticalRate: 3.9,
            criticalStrike:7.8
        },
        {
            defenceRate: 7.3,
            attRate: 5.8,
            criticalRate: 3.9,
            criticalStrike:7.8
        },
        {
            attRate: 5.8,
            criticalRate: 3.9,
            criticalStrike:7.8
        },
        {
            defenceRate: 7.3,
            attRate: 5.8,
            criticalRate: 3.9,
            criticalStrike:7.8
        },
        {
            defenceRate: 7.3,
            attRate: 5.8,
            criticalStrike:7.8
        }
    ]
    let data = {}
    clips.forEach(item => {
        for (const key in item) {
            data[key] = data[key]? (data[key]+item[key]) : item[key]
        }
    })
    return data
}

function calcBjQw (props) {
    let cR = props.criticalRate;
    if(cR>100){cR = 100}
    return 1-(cR/100)+(cR/100)*(1+props.criticalStrike/100)
}

function jt(k){
    return Math.log(0.99316499 + 0.00209988607 * k + 0.0000001213236971*k*k)
}